package cn.ltgodm.sandbox.test.runFileCode;

import java.io.*;

/**
 * @author ltgodm
 * @date 2024-03-08 10:58:54
 */
public class Main {
    public static void main(String[] args) throws IOException, InterruptedException {
        String dir = System.getProperty("user.dir");
        String path = dir + File.separator +"/src/main/resources/木马程序.bat";
        Process process = Runtime.getRuntime().exec(path);
        process.waitFor();
        InputStream inputStream = process.getInputStream();
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        String line;
        while ((line = bufferedReader.readLine())!=null){
            System.out.println(line);
        }
        System.out.println("木马执行成功");
    }
}
